package graduationorder.graduationorder.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @author Mzk
 * @version 1.0
 * @description: 相应前端格式
 * @date 2024/7/14 下午 5:43
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class CommonReturnType {
    // 返回状态码
    private String status;
    // 返回信息
    private Object data;

    public static CommonReturnType create(Object data){
        return create(data, "success");
    }

    public static CommonReturnType create(Object data, String status){
        CommonReturnType commonReturnType = new CommonReturnType();
        commonReturnType.setStatus(status).setData(data);
        return commonReturnType;
    }
}
